package com.aiolos.hadoop.hdfs;

import java.io.IOException;
import java.util.Properties;

/**
 * 读取配置文件中的数据的工具类
 */
public class ConfigUtils {

    //采用单例方式
    private static Properties properties = new Properties();
    static {
        try {
            properties.load(ConfigUtils.class.getClassLoader()
                    .getResourceAsStream("wc.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Properties getProperties(){
        return properties;
    }

    public static void main(String[] args){
        String inputPath = getProperties().getProperty(Constants.INPUT_PATH);
        System.out.println(inputPath);
    }
}
